package Demo3.mapper;

import Demo3.bean.Classes;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ClassesMapper {
    //查全部
    @Select("select * from classes")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(
                    property = "stu",
                  // javaType =List.class,
                    column = "id",
                    many = @Many(select = "Demo3.mapper.StudentMapper.selectByIdCid")
            )
    })
    public abstract List<Classes> selectAll();
}
